/**
 * @author LKQ
 * @date 2022/1/30 13:33
 * @description 欧几里得算法，也叫辗转相除法
 */
public class FormalSolution {
    public static void main(String[] args) {

    }
    public int findGCD(int[] nums) {
        int min = 1001, max = 0;
        for (int a : nums) {
            if (a > max) {
                max = a;
            }
            if (a < min) {
                min = a;
            }
        }
        return gcb(min, max);
    }
    public int gcb(int a, int b) {
        return b == 0 ? a : gcb(b, a % b);
    }
}
